<?php

$id = $_GET["id"];

// 连接数据库
$conn = mysqli_connect('localhost', 'root', 'root', 'newdata');

// 设置编码
mysqli_query($conn, "set charset 'utf8'");
mysqli_query($conn, "set character set 'utf8'");

// sql语句
$sql = "delete from info where id = $id";
// 执行   返回资源类型数据
$res = mysqli_query($conn,$sql);


if($res){
	echo json_encode(array(
		"code" => 200,
		"body" => array(
			"msg" => "删除数据成功"
		)
	));
}else{
	echo json_encode(array(
		"code" => 205,
		"body" => array(
			"msg" => "网络错误，删除失败"
		)
	));
}


?>